<!DOCTYPE html>
<!-- This is the header template for the website. It contains the logo, navigation links, and login/logout buttons. -->
<header class="header">
    <div class="margin"></div>
    <a href="/" class="a-button header-title">论坛</a>

    <div class="header-spacer"></div>

    {% if user %}
        <div class="dropdown">
            <button class="button-dropdown">{{ user.name }}</button>
            <div class="dropdown-content">
                <ul>
                    <li><a href="/user/{{ user.email }}"><div>个人主页</div></a></li>
                    <li><a href="/settings/"><div>设置</div></a></li>
                    <li><a onclick="toggle_theme()"><div>切换主题</div></a></li>
                    <div class="hr" style="margin: 4% 3px;"></div>
                    <li><a href="/logout/"><div class="logout-button">退出登录</div></a></li>
                </ul>
            </div>
        </div>
    {% else %}
        <a onclick="toggle_theme()" style="cursor: pointer;">切换主题</a>
        <a href="/login/" class="a-button"><button class="button-white">登录</button></a>
        <a href="/register/" class="a-button"><button>注册</button></a>
    {% endif %}
    <div class="margin"></div>
</header>
